FROM m.daocloud.io/docker.io/library/alpine AS alpine
LABEL maintainer="陈新亮<chenxinliang@bit.edu.cn>"

ENV IMAGE_NAME=alpine

RUN sed -i "s,dl-cdn.alpinelinux.org,mirrors.tuna.tsinghua.edu.cn,g" /etc/apk/repositories
# RUN sed -i "s,dl-cdn.alpinelinux.org,mirrors.ustc.edu.cn,g" /etc/apk/repositories

RUN apk add --no-cache zsh \ 
	&& sed -i 's,^root\(:.*:\)/bin/sh,root\1/bin/zsh,g' /etc/passwd \
	&& apk add --no-cache vim wget iproute2 iputils-ping tmux git openssh-server openssh \ 
	&& mkdir -p /etc/entrypoint.d 

COPY ./entrypoint.sh /entrypoint.sh
COPY ./entrypoint.d/* /etc/entrypoint.d/
RUN chmod +xr /entrypoint.sh && chmod -R +xr /etc/entrypoint.d

VOLUME [ "/srv" ]

ENTRYPOINT [ "/bin/zsh", "/entrypoint.sh"]
